package com.hnhp.threadlocal;

import com.hnhp.info.PageInfo;

public class LocalPageInfoUtil {
    private static ThreadLocal<PageInfo> localpageInfoThreadLocal = new ThreadLocal<>();

    // 线程上设置一个标签{k,v}
    public static void set(PageInfo pageInfo){
        localpageInfoThreadLocal.set(pageInfo);
    }

    //从线程上获取标签数据，当前标签只是只读
    public static PageInfo get(){
        return localpageInfoThreadLocal.get();
    }

    public static void remove(){
        localpageInfoThreadLocal.remove();
    }
}
